﻿// =====================================================================
//
//  This file is part of the Microsoft Dynamics CRM SDK code samples.
//
//  Copyright (C) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//
// =====================================================================

using System;
using System.ServiceModel;

namespace SL.IdentityModel.Services
{
	/// <summary>
	/// Class contains information to make WCF service call in ClaimsIdentitySessionManager
	/// </summary>
	internal class ServiceCallState
	{
		private Action _action;
		private string _appliesTo;
		private IClientChannel _channel;

		/// <summary>
		/// delegate containing service call
		/// </summary>
		internal Action Action
		{
			get { return _action; }
		}

		/// <summary>
		/// AppliesTo of target service, used fo 
		/// </summary>
		internal string AppliesTo
		{
			get { return _appliesTo; }
			set { _appliesTo = value; }
		}

		/// <summary>
		/// service call channel, used to set message header
		/// </summary>
		internal IClientChannel Channel
		{
			get { return _channel; }
		}

		/// <summary>
		/// creates a new instance of the class
		/// </summary>
		/// <param name="action"></param>
		/// <param name="channel"></param>
		/// <param name="appliesTo"></param>
		internal ServiceCallState(Action action, IClientChannel channel, string appliesTo)
		{
			_action = action;
			_appliesTo = appliesTo;
			_channel = channel;
		}
	}
}
